//
//  DownloadOperation.h
//  Example13-2
//
//  Created by 孙晓晔 on 2017/4/25.
//  Copyright © 2017年 孙晓晔. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

// 代码块
typedef void(^completionDownload)(NSString *url, NSData *data);

// 协议
@protocol DownloadOperationDelegate <NSObject>

-(void)didFinishDownload:(NSString*)strURL data:(NSData *)data; // 下载完成

@end

@interface DownloadOperation : NSOperation

@property(nonatomic,strong) NSString *strURL;
@property(nonatomic,strong) NSString *filePath;

@property(nonatomic,strong) id<DownloadOperationDelegate> delegate;

/**
 *  回调
 */
@property (nonatomic,copy)completionDownload block;
- (instancetype)initWithUrl:(NSString*)url;

@end
